//
//  ImageTitleModel.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/7/19.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "ImageTitleModel.h"

@implementation ImageTitleModel

- (id)copyWithZone:(NSZone *)zone
{
    ImageTitleModel *model = [[ImageTitleModel allocWithZone:zone] init];
    model.clubContent = self.clubContent;
    model.clubImage = self.clubImage;
    model.ID = self.ID;
    model.clubId = self.clubId;
    [model.clubImageList addObjectsFromArray:self.clubImageList];
    return model;
}
- (void)replaceTheModel:(ImageTitleModel *)model
{
    self.clubContent = model.clubContent;
    self.clubImage = model.clubImage;
    self.ID = model.ID;
    self.clubId = model.clubId;
    [self.clubImageList removeAllObjects];
    [self.clubImageList addObjectsFromArray:model.clubImageList];
}

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.clubContent = dict[@"clubContent"];
        self.clubImage = dict[@"clubImage"];
        self.ID = [dict[@"id"] integerValue];
        self.clubId = [dict[@"clubId"] integerValue];
        [self.clubImageList addObjectsFromArray:dict[@"clubImageList"]];
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[ImageTitleModel alloc]initWithDict:dict];
}

- (NSMutableArray *)clubImageList
{
    if (!_clubImageList) {
        _clubImageList = [NSMutableArray array];
    }
    return _clubImageList;
}

@end
